import { SFootballGameInfo } from "../../../../Message/Game/SFootballGameInfo";
type int = number;
//class FGTeamInfo
    
    export  class FGTeamInfo
    {
        

        public get isWinerA(): Boolean
        {
            return this._isWinerA;
        }

        public get guessedTeamName(): string
        {
            return this._guessedTeamName;
        }

        public get guessedTeam(): int
        {
            return this._guessedTeam;
        }

        public get isGuessA(): Boolean
        {
            return this._isGuessA;
        }

        public get isHasGuess(): Boolean
        {
            return this._isHasGuess;
        }

        public get winerId(): int
        {
            return this._winerId;
        }

        public get isHasResult(): Boolean
        {
            return this._isHasResult;
        }

        public get isGuessSuccess(): Boolean
        {
            return this._isGuessSuccess;
        }

        public get winerName(): string
        {
            return this._winerName;
        }

        public get gameInfo(): SFootballGameInfo
        {
            return this._gameInfo;
        }

        public set gameInfo(arg1: SFootballGameInfo)
        {
            this._gameInfo = arg1;
            this.parse();
            return;
        }

        /* internal  */parse(): void
        {
            this._isHasGuess = this._gameInfo.guess > 0;
            if (this._gameInfo.guess != this._gameInfo.teamA) 
            {
                this._guessedTeam = this._gameInfo.teamB;
                this._guessedTeamName = this._gameInfo.teamBName;
            }
            else 
            {
                this._guessedTeam = this._gameInfo.teamA;
                this._guessedTeamName = this._gameInfo.teamAName;
            }
            this._isHasResult = this._gameInfo.result > 0;
            this._winerId = this._gameInfo.result;
            if (this._gameInfo.result != this._gameInfo.teamA) 
            {
                this._winerName = this._gameInfo.teamBName;
            }
            else 
            {
                this._winerName = this._gameInfo.teamAName;
            }
            this._isWinerA = this._isHasResult && this._gameInfo.result == this._gameInfo.teamA;
            this._isGuessA = this._gameInfo.guess == this._gameInfo.teamA;
            this._isGuessSuccess = this._gameInfo.guess > 0 && this._gameInfo.result > 0 && this._gameInfo.guess == this._gameInfo.result;
            return;
        }

        /* internal */ /* var */_gameInfo: SFootballGameInfo;

        /* internal */ /* var */_guessedTeam: int;

        /* internal */ /* var */_guessedTeamName: string;

        /* internal */ /* var */_isHasResult: Boolean;

        /* internal */ /* var */_winerId: int;

        /* internal */ /* var */_winerName: string;

        /* internal */ /* var */_isGuessSuccess: Boolean;

        /* internal */ /* var */_isHasGuess: Boolean;

        /* internal */ /* var */_isGuessA: Boolean;

        /* internal */ /* var */_isWinerA: Boolean;
    }
